package com.example.foods.domain;

import lombok.Data;

@Data
public class AjaxResult {
    private int code;
    private Object data;
    private String msg;

    public AjaxResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public AjaxResult(Object data) {
        this.data = data;
    }

    public static AjaxResult ok(Object data) {
        return new AjaxResult(data);
    }

    public static AjaxResult error(int code, String msg) {
        return new AjaxResult(code, msg);
    }
}
